<include file="Public:headern"/>
<div class="top"><a href="{:U('Membership/index')}" id="back"><img src="__PUBLIC__/Catalog/nimages/tb.png"/></a>
    <p>提现管理</p>
</div>

<div class="S-user_head">
   <img src="<if condition="$member['headimg'] neq ''">__PUBLIC__/images/memberhead/thumb/m_{$member.headimg}<elseif condition='$member["headimgurl"] neq ""'/>{$headimgurl}<else/>__PUBLIC__/Catalog/nimages/touxiang.jpg</if>" class="user" />
   <p class="m1">会员ID：{$member.member_id}</p>
   <p class="m2">
     <i class="S-xin_red"></i><i class="S-xin_red"></i><i class="S-xin_red"></i>
     <span>(2015)</span>
   </p>
</div>

<div class="S-user_box1">
  <ul class="kuang3">
    <li class="m1">可用：<span><if condition="$moneylog['active_money'] eq ''">0<else/>{$moneylog.active_money}</if></span> 元</li>
    <li class="m2">冻结：<if condition="$moneylog['freeze_money'] eq ''">0<else/>{$moneylog.freeze_money}</if> 元</li>
    <li class="m3">总额：<if condition="$moneylog['account'] eq ''">0<else/>{$moneylog.account}</if> 元</li>
  </ul>
  <div class="S-dandukuanng">
    <form action="{:U('Membership/deposit')}" id="depositform" method="post">
   		<input type="hidden" name="member_bank_id" value="{$bank.member_bank_id}"/>
   		<input type="hidden" name="active_money" value="<if condition="$moneylog['active_money'] eq ''">0<else/>{$moneylog.active_money}</if>" id="active_money"/>
    	<input type="text"  id="money" name="money" class="tx" placeholder="请输入提现金额" />
   	    <input type="button" id="tijiao"  class="sub" value="确认提现"/>
   	</form>
  </div>
</div>

<div class="S-user_box1">
    <ul class="kuang3 S-tabk">
       <li><a href="javascript:void(0);" class="cover">提现记录</a></li>
       <li><a href="javascript:void(0);">冻结记录</a></li>
       <li><a href="javascript:void(0);">资金变动记录</a></li>
    </ul>

<table class="S-table">
  <tr class="title">
    <td>提现时间</td>
    <td>金额</td>
    <td>提现状态</td>
  </tr>
   <if condition="$depositlist eq ''">
      <tr>
          <td colspan="3">暂无提现记录</td>
      </tr>
   </if>
   <foreach name="depositlist" item="vo">
            <tr>
               <td>{$vo.withdraw_date}</td> 
               <td>{$vo.money}</td> 
               <td <if condition="$vo['flag'] eq 0">style="color:#F00">处理中<elseif condition="$vo['flag'] eq 1"/>style="color:#CCC">成功<else/> style="color:#F00">失败</if></td>
            </tr>
   </foreach>
</table>
<table class="S-table" style="display:none;">
  <tr class="title">
    <td>冻结时间</td>
    <td>金额</td>
    <td>冻结状态</td>
  </tr>
   <if condition="$freeze eq ''">
        <tr>
        	<td colspan="3">暂无冻结记录</td>
        </tr>
   </if>
   <foreach name="freeze" item="vo">
         <tr>
               <td>{$vo.moneylog_affect_date}</td> 
               <td>{$vo.affect_money}</td> 
               <td <if condition="$vo['freeze_flag'] eq 0">style="color:#F00">冻结中<else/>style="color:#CCC;">已解冻</if></td>
         </tr>
   </foreach>
</table>
<table class="S-table" style="display:none;">
  <tr class="title">
    <td>时间</td>
    <td>变动金额</td>
    <td>说明</td>
  </tr>
  <if condition="$allaccount eq ''">
       <tr>
       	<td colspan="3">资金变动记录</td>
       </tr>
  </if>
  <foreach name="allaccount" item="vo">
       <tr>
          <td>{$vo.moneylog_affect_date}</td> 
          <td>{$vo.affect_money}</td> 
          <td>{$vo.name}</td>
       </tr>
  </foreach>
</table>
<script type="text/javascript">
$(document).ready(function(e) {
    $(".S-tabk li a").click(function(){
	    $(".S-tabk li a").removeClass("cover");
		$(this).addClass("cover");
		var index = $(this).parent("li").index();
		$(".S-table").hide().eq(index).show();
	})
});

$(function(){
    if('{$msg}'!='0'){
        alert('{$msg}');
    }
});
$('#tijiao').bind('click',function(){
	var active_money=$('#active_money').val();
	var money = $('#money').val();
	if(money<100){
		alert('提现金额不能小于100元');
		return false;
	}else if(money > active_money){
		alert('提现金额不能大于账户总活动金额');
		return false;
	}else{
		$('#depositform').submit();
	}
})
</script>
</div>

<include file="Public:footern" />
